import {createRouter, createWebHistory, type RouteRecordRaw} from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'home',
    redirect: '/router',
  },
  {
    path: '/router',
    name: 'router',
    component: () => import('@/views/router-view.vue')
  },
  {
    path: '/doc-api/:routerId',
    name: 'DocApi',
    component: () => import('@/views/api-doc-view.vue')
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [...routes],
})

export default router
